Skip to content

fix(deps): declare Pillow so mesh ops keep their textures - #435

Merged
lightningpixel merged 1 commit into
devfrom
fix/pillow-textures
Nov 12, 2026
Merged

lightningpixel merged 1 commit into
devfrom
fix/pillow-textures

Conversation

@lightningpixel

Copy link
Copy Markdown
Owner

Problem

Prepare for Game (and any op that reloads and re-exports a mesh with trimesh: presets, transforms, normals…) returned the mesh without its textures in the app.

Root cause

trimesh decodes glTF images with Pillow, but Pillow is optional for trimesh and was never listed in api/requirements.txt. The venv created by setup (<dependenciesDir>/venv) therefore has no Pillow. trimesh then drops every image without raising an error, and the re-exported GLB has bare materials.

The dev api/.venv happened to have Pillow installed, which is why tests and local checks never caught it.

Reproduced with the setup venv on a textured Sketchfab GLB: 8 images in, 0 out. With Pillow on the path: 10 out (textures kept).

Fix

  • Add Pillow>=10.0 to api/requirements.txt, with a comment explaining why.
  • Regression test api/tests/test_requirements.py checks that Pillow stays declared.
  • Changing requirements.txt changes its hash, so existing installs re-run setup and install Pillow on the next launch.

trimesh decodes glTF images with Pillow but does not depend on it. The
setup venv therefore had no Pillow, and every op that reloads and
re-exports a mesh (presets, transforms, normals) silently wrote it back
without its textures. The dev .venv happened to have it, which hid the bug.

Changing requirements.txt also changes its hash, so existing installs
re-run setup and get Pillow on the next launch.
@lightningpixel
lightningpixel merged commit 37dca66 into dev Nov 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant